<?php
// =====================================================
// AnthroHeart - Simple Unique Daily Visitor Counter
// =====================================================
$counter_file = __DIR__ . '/visitors.txt';
$unique_file  = __DIR__ . '/unique_visitors.txt';

if (!file_exists($counter_file)) { file_put_contents($counter_file, "0", LOCK_EX); }
if (!file_exists($unique_file)) { file_put_contents($unique_file, serialize([]), LOCK_EX); }

$count_raw = @file_get_contents($counter_file);
$count = is_string($count_raw) ? (int)trim($count_raw) : 0;

$ip = $_SERVER['REMOTE_ADDR'] ?? 'unknown';
$date = date('Y-m-d');
$visitor_key = hash('sha256', $ip . '|' . $date);

$unique_raw = @file_get_contents($unique_file);
$unique_visitors = @unserialize($unique_raw);
if (!is_array($unique_visitors)) { $unique_visitors = []; }

if (!in_array($visitor_key, $unique_visitors, true)) {
    $unique_visitors[] = $visitor_key;
    $count++;
    file_put_contents($counter_file, (string)$count, LOCK_EX);
    file_put_contents($unique_file, serialize($unique_visitors), LOCK_EX);
}

// Configuration for SEO
$site_url = "https://anthroheart.com";
$preview_img = $site_url . "/blueheart.png"; // PNG for social previews
$description = "Free public domain release of the complete AnthroHeart studio ecosystem (AnthrOS + Studio-in-a-Box). Bitcoin-timestamped, 1.5Gbps high-velocity origin seed.";
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>The AnthroHeart Collection – Public Domain Release</title>

    <!-- Standard Meta Tags -->
    <meta name="description" content="<?= $description ?>">
    <meta name="keywords" content="anthroheart, anthros, public domain, cc0, bitcoin timestamp, open source, creative tools, digital preservation">
    <meta name="author" content="Anthro Entertainment LLC">

    <!-- Open Graph / Facebook / Telegram / Discord -->
    <meta property="og:type" content="website">
    <meta property="og:url" content="<?= $site_url ?>/">
    <meta property="og:title" content="The AnthroHeart Collection">
    <meta property="og:description" content="<?= $description ?>">
    <meta property="og:image" content="<?= $preview_img ?>">
    <meta property="og:image:type" content="image/png">
    <meta property="og:site_name" content="AnthroHeart">

    <!-- Twitter / X -->
    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:url" content="<?= $site_url ?>/">
    <meta name="twitter:title" content="The AnthroHeart Collection">
    <meta name="twitter:description" content="<?= $description ?>">
    <meta name="twitter:image" content="<?= $preview_img ?>">
    <meta name="twitter:image:alt" content="AnthroHeart BlueHeart Anthro Cosmic Art">

    <style>
    body {
      font-family: "Courier New", monospace;
      background: #1a1a1a url('blueheart.webp') center center fixed;
      background-size: cover;
      color: #00ff00;
      padding: 20px;
      max-width: 850px;
      margin: auto;
      position: relative;
    }

    body::before {
      content: "";
      position: fixed;
      top: 0; left: 0; right: 0; bottom: 0;
      background: rgba(10, 10, 10, 0.82);
      pointer-events: none;
      z-index: -1;
    }

    h1 { border-bottom: 2px solid #00ff00; padding-bottom: 10px; font-size: 1.8em; }
    h2 { color: #fff; font-size: 1.2em; margin-top: 0; }

    .box {
      border: 1px solid #333;
      background: rgba(25, 25, 25, 0.9);
      backdrop-filter: blur(8px);
      padding: 20px;
      margin-top: 20px;
      border-radius: 4px;
      box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    }

    .stats-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: 10px;
      margin-top: 10px;
    }

    .stat-item {
      background: rgba(0, 255, 0, 0.05);
      border: 1px dashed #00ff00;
      padding: 10px;
      font-size: 0.9em;
    }

    a { color: #00ff00; text-decoration: none; font-weight: bold; }
    a:hover { text-decoration: underline; background: #003300; }

    .download-btn {
      display: inline-block;
      background: #00ff00;
      color: #000;
      padding: 12px 24px;
      font-size: 1.1em;
      margin: 5px;
      border-radius: 2px;
    }
    .download-btn:hover { background: #fff; border-radius: 8px; transition: 0.3s; }

    ul { padding-left: 20px; }
    li { margin-bottom: 8px; }

    .highlight { color: #fff; }
    </style>
</head>

<body>

    <h1>THE ANTHROHEART COLLECTION</h1>

    <p>
    <strong>Status:</strong> Public Domain (CC0)<br>
    <strong>Date:</strong> December 25, 2025<br>
    <strong>Notarization:</strong> Bitcoin Blockchain (Block 929481)<br>
    <strong>Publisher:</strong> Anthro Entertainment LLC
    </p>

    <div class="box">
    <h2>🛰️ INFRASTRUCTURE STATUS</h2>
    <p>Seeding is live from our BBR-optimized origin node. High-speed uplink ensures rapid global propagation.</p>
    <div class="stats-grid">
      <div class="stat-item">🚀 <strong>Uplink (Seeding):</strong> 440+ Mbps (Dedicated)</div>
      <div class="stat-item">📈 <strong>Downlink (Burst):</strong> 1,860+ Mbps</div>
      <div class="stat-item">🧠 <strong>Congestion Logic:</strong> BBR Optimized</div>
      <div class="stat-item">🛡️ <strong>Node Identity:</strong> IONOS High-Velocity</div>
    </div>
    </div>

    <div class="box">
    <h2>📂 DOWNLOADS</h2>
    <p>The complete AnthroHeart studio ecosystem (5.33 GB).</p>
    <a href="http://archive.anthroentertainment.com" class="download-btn" target="_blank">⬇️ ARCHIVE MIRROR</a>
    <a href="/bundle.torrent" class="download-btn">⬇️ TORRENT (MAGNET)</a>
    </div>

    <div class="box">
    <h2>🛡️ VERIFICATION PROOFS</h2>
    <p>Independent cryptographic evidence of existence and authorship.</p>
    <ul>
    <li><a href="release_proof_20251225.json">📄 Release Manifest (JSON)</a> - Contains SHA-256/512 hashes.</li>
    <li><a href="release_proof_20251225.json.ots">⛓️ Bitcoin Timestamp Proof (.ots)</a> - Anchored to Block 929481.</li>
    </ul>
    <p><em>Verify independently at <a href="https://opentimestamps.org" target="_blank">opentimestamps.org</a></em></p>
    </div>

    <div class="box">
    <h2>🧰 REPRODUCIBLE NOTARIZATION</h2>
    <p>Transparency is the foundation of trust. We provide the exact tooling used to anchor this release.</p>
    <ul>
    <li><a href="notarize_anthroheart.py.txt">📜 Genesis Notarization Script</a></li>
    <li><a href="ANCHOR-TO-BITCOIN.py.txt">📜 Origin Anchor Script</a></li>
    </ul>
    <p><small><em>* No paid permanence services were used. Sovereignty and hosting are intentionally separated.</em></small></p>
    </div>

    <div class="box">
    <h2>ℹ️ ABOUT</h2>
    <p>
    The AnthroHeart Collection contains <span class="highlight">AnthrOS</span> and <span class="highlight">Studio-in-a-Box</span>. 
    Formerly commercial. Now a gift for all creators to adapt, remix, and build upon.
    </p>
    <p>
    <a href="https://www.anthroentertainment.com" target="_blank">Anthro Entertainment LLC</a>
    </p>
    </div>

    <div class="box" style="text-align: center; margin-top: 40px; background: rgba(0, 51, 0, 0.85); border: 1px solid #00ff00;">
      <p style="font-size: 1.3em; margin: 10px 0;">
        🌍 <strong>Creators who have discovered this release:</strong>
      </p>
      <p style="font-size: 3.5em; margin: 10px 0; color: #00ff00; text-shadow: 0 0 15px #00ff00;">
        <?= number_format($count) ?>
      </p>
      <p style="font-size: 0.8em; opacity: 0.7;">
        (Unique daily visitors – High Integrity Count ✨)
      </p>
    </div>

</body>
</html>